/*
*    Phantom v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
// Input.cpp: implementation of the CInput class.
//
//////////////////////////////////////////////////////////////////////

#include "ssi_input.h"
#include "ssi_input.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

SSI_INT64 GetUniqueLineID(){
	static SSI_INT64 ID = 0;
	ID = ID + 1;
	return ID;
}



CInput::CInput()
: RunMode(0)
, Debugger(NULL)
{
  CurrLine = SSI_NULL;
}

CInput::~CInput()
{
}

void CInput::PushPointer(CFlowStruct &New)
{
  Flows.push(New);
}

SSI_BOOL CInput::PopPointer(CFlowStruct &Ret)
{
  return Flows.pop(Ret);
}

void CInput::SetCurrLine(ScriptNode *NewCurr)
{
  CurrLine = NewCurr;
}

ScriptNode* CInput::GetCurrLine()
{
  return CurrLine;
}


void CInput::SetInputName(const String& Name)
{
  InpName = Name;
}

void CInput::SetFileName(const String& Name)
{
  FileName = Name;
}

String CInput::GetInputName()
{
  return InpName;
}

String CInput::GetFileName()
{
  return FileName;
}

ScriptNode* CInput::PushLine(CScriptLine& NewLine)
{
	NewLine.ID = GetUniqueLineID();
	return Lines.push(NewLine);
}

void CInput::ClearLines(void)
{
	Lines.Clear();
}

ScriptNode* CInput::GetTopLine(void)
{
	return Lines.getTop();
}

ScriptNode* CInput::GetByID(SSI_INT64 ID)
{
	CScriptLine aLine;
	aLine.ID = ID;
	return Lines.find(aLine);
}

SSI_INT64 CInput::Query(const CScriptStatement& aStatement)
{
	return 1;
}



